import { axios } from '@choerodon/master';

// 停用
function stopRecord(projectId:string, id:string) {
  return axios.put(`/devops/v1/projects/${projectId}/pipelines/${id}/disable`);
}
// 启用
function startRecord(projectId:string, id:string) {
  return axios.put(`/devops/v1/projects/${projectId}/pipelines/${id}/enable`);
}
// 删除
function deleteRecord(projectId:string, id:string) {
  return axios.delete(`/devops/v1/projects/${projectId}/pipelines/${id}`);
}
// 执行
function executeRecord(projectId:string, id:string) {
  return axios.post(`/devops/v1/projects/${projectId}/pipelines/${id}/execute`);
}
export {
  deleteRecord,
  stopRecord,
  startRecord,
  executeRecord,
};
